//
// Copyright (c) 2024 BPer
//

#ifndef INCLUDE_BPERSTREAM_BPERSTREAMCAPTURE_H_
#define INCLUDE_BPERSTREAM_BPERSTREAMCAPTURE_H_
#include <stdint.h>
#include <bperutil/BPerAvType.h>

typedef struct{
	void* context;
	uint8_t* (*getVideoData)(void* pcontext);
	int32_t (*getVideoLen)(void* pcontext);
	int32_t (*getVideoFrametype)(void* pcontext);
	int64_t (*getVideoTimestamp)(void* pcontext);

	uint8_t* (*getAudioData)(void* pcontext);
	int32_t (*getAudioLen)(void* pcontext);
	int64_t (*getAudioTimestamp)(void* pcontext);
	BPerAudioCodec (*getAudioType)(void* pcontext);

	void (*initVideo)(void* pcontext,int32_t transtype);
	void (*setVideoData)(void* pcontext,BPerFrame *videoFrame, BPerVideoCodec videoType);
	void (*setVideoMeta)(void* pcontext,uint8_t *p, int32_t plen, BPerVideoCodec videoType);
	void (*setMetaTimestamp)(void* pcontext,int64_t timestamp);
	void (*setVideoFrametype)(void* pcontext,int32_t frametype);

	void (*setAudioData)(void* pcontext,BPerFrame *audioFrame);
	void (*setAudioMetaData)(void* pcontext,uint8_t *p, int32_t plen);
	void (*setAudioFrametype)(void* pcontext,int32_t frametype);
	void (*initAudio)(void* pcontext,int32_t transType,int32_t sample,int32_t channel,BPerAudioCodec audioType);

	BPerFrame* (*getVideoFrame)(void* pcontext);
	BPerFrame* (*getAudioFrame)(void* pcontext);


}BPerStreamCapture;
#ifdef __cplusplus
extern "C"{
#endif
void bPer_create_streamCapture(BPerStreamCapture* stream);
void bPer_destroy_streamCapture(BPerStreamCapture* stream);
#ifdef __cplusplus
}
#endif
#endif /* INCLUDE_BPERSTREAM_BPERSTREAMCAPTURE_H_ */
